
interface DBI<T>{
  add(info:T):boolean;
  delete(info:T, id:number):boolean;
  updata(id:number):boolean;
  get(id:number):any[];
}
class MysqlDbClass<T> implements DBI<T>{
  add(info: T): boolean {
    console.log('数据库：', info);
    return true;
  }
  delete(info: T, id: number): boolean {
    return true;
  }
  updata(id: number): boolean {
    return true;
  }
  get(id: number): any[] {
    let list = [
      {
        title: "周一",
        id: 1
      },
      {
        title: "周二",
        id: 2
      },
      {
        title: "周三",
        id: 3
      },
      {
        title: "周四",
        id: 4
      },
    ]
    return list;
  }
}

class MyssqlDbClass<T> implements DBI<T>{
  add(info: T): boolean {
    console.log('数据库s：', info);
    return true;
  }
  delete(info: T, id: number): boolean {
    return true;
  }
  updata(id: number): boolean {
    return true;
  }
  get(id: number): any[] {
    let list = [
      {
        title: "周一",
        id: 1
      },
      {
        title: "周二",
        id: 2
      },
    ]
    return list;
  }
}
export {MysqlDbClass, MyssqlDbClass};